From: kaf24@firebug.cl.cam.ac.uk Date: Wed, 5 Oct 2005 13:10:49 +0000 (+0100) Subject: Handle the case where there are no spaces or parameters X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~16763^2~38^2~1 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=792c98fdf60c07a4635b3d9e6c3ca0e2565cd681;p=xen.git Handle the case where there are no spaces or parameters after the image name on the command line. Signed-off-by: Mike Day --- diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index f070b6303e..5131250cbb 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -475,13 +475,14 @@ void __init __start_xen(multiboot_info_t *mbi) { static char dom0_cmdline[MAX_GUEST_CMDLINE]; - /* Skip past the image name. */ + /* Skip past the image name and copy to a local buffer. */ while ( *cmdline == ' ' ) cmdline++; if ( (cmdline = strchr(cmdline, ' ')) != NULL ) + { while ( *cmdline == ' ' ) cmdline++; + strcpy(dom0_cmdline, cmdline); + } - /* Copy the command line to a local buffer. */ - strcpy(dom0_cmdline, cmdline); cmdline = dom0_cmdline; /* Append any extra parameters. */